import http from '@/utils/request'
//获取用户信息
export const getUser = () => {
    return async dispatch => {
      const {data} = await http.get('/user')
      dispatch(saveInfo(data))
    }
  }
  // 存储信息到redux
export const saveInfo = (user) => {
    return {
        type: 'profile/user',
        payload: user
    }
}